package com.app.qbake.base.bean;

import com.wind.base.adapter.DisplayItem;
import com.wind.base.bean.UploadFile;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by wind on 2017/3/1.
 */
public class UploadPhoto extends UploadFile implements DisplayItem {
    public UploadPhoto(String path){
        super(path);
    }
    public UploadPhoto(int resId){
        this.resId=resId;
    }

    private Map<String,String> extra;
    /**
     * app中的资源图片
     */
    private int resId;

    private Boolean isNo = false;

    public Boolean getNo() {
        return isNo;
    }

    public void setNo(Boolean no) {
        isNo = no;
    }

    public int getResId() {
        return resId;
    }

    public void setResId(int resId) {
        this.resId = resId;
    }



    public void put(String key,String value){
        if (extra==null){
            extra=new HashMap<>();
        }
        extra.put(key,value);
    }

    public Map<String, String> getExtra() {
        return extra;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj==this){
            return true;
        }
        if (obj instanceof UploadPhoto){
            UploadPhoto that= (UploadPhoto) obj;


            if ( !that.getPath().equals(getPath()))
                return false;
            if (that.getResId()!=(getResId()))
                return false;

            return true;
        }
        return false;
    }
}
